<template>
  <div id="home">
    <!-- 轮播图 -->
    <mt-swipe :auto="4000" style="height:200px;background:red;">
      <mt-swipe-item v-for="(item,index) in lunbo" :key="index">
        <img src="item.img" alt="">
        <span>{{item.name}}</span>
      </mt-swipe-item>
      
    </mt-swipe>
  </div>
</template>

<script>
export default {
  //组件名
  name: "Home",
  data() {
    return {
      lunbo: [],
    };
  },
  //组件创建之后
  created() {
    this.$axios
      .get("/jianzhi")
      .then((res) => {
        console.log(res.data);
        this.lunbo = res.data;
      })
      .catch((err) => {
        console.log("轮播图数据异常");
      });
  },
};
</script>

<style scoped lang="css">
</style>
